<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang"ja" lang="ja">
<head>
    <title>作業時間管理 on GAE | 一括作成</title>
    <link type="text/css" rel="stylesheet" href="/stylesheets/default.css"/>
    <link type="text/css" rel="stylesheet" href="/stylesheets/alert.css"/>
    <link type="text/css" rel="stylesheet" href="/stylesheets/alphacube.css"/>    
    <script type="text/javascript" src="/scripts/prototype.js"> </script>
    <script type="text/javascript" src="/scripts/effects.js"> </script>
    <script type="text/javascript" src="/scripts/window.js"> </script>
    <script type="text/javascript" src="/scripts/window_effects.js"> </script>
    <script type="text/javascript" src="/scripts/debug.js"> </script>
	<!-- mfkd libraly //-->
    <link type="text/css" rel="stylesheet" href="/stylesheets/workingtimeinput.css" />
	<script type="text/javascript" src="/scripts/mfkd.js"></script>
	<script type="text/javascript">
		window.onload = function() {
			Focus.Index = {	kaishi:"syuryo",
						    syuryo:"jitudo",
						    jitudo:"zan_futu",
						    zan_futu:"zan_sinya",
						    zan_sinya:"zan_gokei",
						    zan_gokei:"comment",
						    comment:"enter"};
		    //
		    $("kaishi").onfocus    = function() { Focus.GotFocus(this);};
		    $("kaishi").onblur     = function() { Focus.LostFocus(this); };
		    $("kaishi").focus();
		    //
		    $("syuryo").onfocus    = function() { Focus.GotFocus(this);};
		    $("syuryo").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("jitudo").onfocus    = function() { Focus.GotFocus(this);};
		    $("jitudo").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("zan_futu").onfocus    = function() { Focus.GotFocus(this);};
		    $("zan_futu").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("zan_sinya").onfocus    = function() { Focus.GotFocus(this);};
		    $("zan_sinya").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("zan_gokei").onfocus    = function() { Focus.GotFocus(this);};
		    $("zan_gokei").onblur     = function() { Focus.LostFocus(this); };
		    //
		    $("comment").onfocus    = function() { Focus.GotFocus(this);};
		    $("comment").onblur     = function() { Focus.LostFocus(this); };
		}
		function keypress(event, id) {
	        // ｷｰの取得
	        if (event.keyCode != 0) { key = event.keyCode; }
	        else { key = event.charCode; }
	        
	        if ( id == "kaishi" ) { Validator.Validation($(id), key, {"IsTime":""}); }
	        if ( id == "syuryo" ) { Validator.Validation($(id), key, {"IsTime":""}); }
	        if ( id == "jitudo" )    { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "zan_futu" )  { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "zan_sinya" ) { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "zan_gokei" ) { Validator.Validation($(id), key, {"IsNumeric":""}); }
	        if ( id == "comment" ) { Validator.Validation($(id), key); }
		};
		function check() {
			var err = "";

			err = Validator.IsTime($("kaishi").value);
			if (err != "") {
				Validator.ShowAlert($("kaishi"), err);
				return false;
			};
			
			err = Validator.IsTime($("syuryo").value);
			if (err != "") {
				Validator.ShowAlert($("syuryo"), err);
				return false;
			};

			err = Validator.IsNumeric($("jitudo").value);
			if (err != "") {
				Validator.ShowAlert($("jitudo"), err);
				return false;
			};

			err = Validator.IsNumeric($("zan_futu").value);
			if (err != "") {
				Validator.ShowAlert($("zan_futu"), err);
				return false;
			};

			err = Validator.IsNumeric($("zan_sinya").value);
			if (err != "") {
				Validator.ShowAlert($("zan_sinya"), err);
				return false;
			};

			err = Validator.IsNumeric($("zan_gokei").value);
			if (err != "") {
				Validator.ShowAlert($("zan_gokei"), err);
				return false;
			};

			document.myform.submit();
		}		
	</script> 	
</head>
<body>
	<!-- メニュー -->
	<div class="menu">
		<ul>
			<li>&nbsp;</li>
		</ul>
	</div>
    <!-- コンテンツ -->
	<div class="contents">
		<p class="title">一括作成（{{ fromtodate_str}}）</p>	
	    <form name="myform" action="/SetInitial" method="post">            
	    <table>
	        <tr class="header">
	            <th>作業開始</th>
	            <th>作業終了</th>
	            <th>実働時間</th>
	            <th>普通残業</th>
	            <th>深夜残業</th>
	            <th>残業合計</th>
	            <th>有休消化等</th>
	        </tr>
	        <tr>
	            <td><input type="text" id="kaishi" name="kaishi" size="6" maxlength="5" value="{{ userinfo.kaishi }}" onkeypress="keypress(event, 'kaishi');" /></td>
	            <td><input type="text" id="syuryo" name="syuryo" size="6" maxlength="5" value="{{ userinfo.syuryo }}" onkeypress="keypress(event, 'syuryo');" /></td>
	            <td><input type="text" id="jitudo" name="jitudo" size="6" maxlength="5" value="{{ userinfo.jitudo }}" onkeypress="keypress(event, 'jitudo');" /></td>
	            <td><input type="text" id="zan_futu" name="zan_futu" size="6" maxlength="5" value="{{ userinfo.zan_futu }}" onkeypress="keypress(event, 'zan_futu');" /></td>
	            <td><input type="text" id="zan_sinya" name="zan_sinya" size="6" maxlength="5" value="{{ userinfo.zan_sinya }}" onkeypress="keypress(event, 'zan_sinya');" /></td>
	            <td><input type="text" id="zan_gokei" name="zan_gokei" size="6" maxlength="5" value="{{ userinfo.zan_gokei }}" onkeypress="keypress(event, 'zan_gokei');"/></td>
	            <td><input type="text" id="comment" name="comment" size="34" maxlength="30" onkeypress="keypress(event, 'comment');" /></td>
	        </tr>
	    </table>
	    <br />
	    <input type="button" id="enter" value="実行" onclick="check()"/><input type="reset" id="reset" value="リセット"/>
	    <input type="hidden" name="date" value="{{ backmonth_str }}"/>
	    <input type="hidden" name="fromdate" value="{{ fromdate_str }}"/>
	    <input type="hidden" name="todate" value="{{ todate_str }}"/>    
		</form>
	</div>
</body>
</html>

